// 测试真实天气API的简单版本
async function simpleWeatherTest() {
  try {
    const response = await fetch('https://v2.xxapi.cn/api/weather?city=赣州市')
    const data = await response.json()
    console.log('真实天气数据:', data)
    
    if (data.code === 200 && data.data?.data?.length > 0) {
      const today = data.data.data[0]
      console.log('今日天气:', {
        城市: data.data.city,
        温度: today.temperature,
        天气: today.weather,
        风力: today.wind,
        空气质量: today.air_quality
      })
    }
  } catch (error) {
    console.error('API调用失败:', error)
  }
}

// 页面加载后测试
window.addEventListener('load', () => {
  setTimeout(simpleWeatherTest, 1000)
})

export { simpleWeatherTest }
